package serverMessage;
import java.io.Serializable;

import time.LogicalTimeStamp;

public class ServerMessage implements Serializable{
	private static final long serialVersionUID = 3297634490602449207L;
	private int messageType;
	private LogicalTimeStamp messageTS;
	
	public static final int USER_LOGIN_ANNOUNCMENT = 1; // multicast message
	public static final int REGISTER_ME_REQUEST = 2;    // multicast message
	public static final int REGISTER_ME_RESPONSE = 3;   // unicast message
	public static final int WRITE_COMMAND = 4;			// multicast message
	public static final int FIND_NEIGHBOR = 5;			// multicast message
	public static final int ASK_USER_PUB_KEY = 6;       // multicast message
	public static final int USER_PUB_KEY = 7; 			// unicast message
	
	public ServerMessage(int type, LogicalTimeStamp msgTS){
		this.messageType = type;
		this.messageTS = msgTS;
	}
	
	public LogicalTimeStamp getMessageTS(){
		return this.messageTS;
	}
	
	public String toString(){
		return "ServerMessage:" + " type=" + this.messageType;
	}
}
